# 展示原始数据图
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']='SimHei'
plt.rcParams['axes.unicode_minus'] = False
data = pd.read_csv(r"原始水质参数集.csv", sep=',',encoding='gbk')
print(data.head())
data = data.iloc[:,2:]
print(data.head())
plt.figure(figsize=(12,8))
for i in range(46):
    data.iloc[i,:].plot()
plt.title("原始光谱图像")
plt.savefig("原始光谱图像.png")
plt.show()
# 展示去噪之后的光谱图
data1 = pd.read_csv(r"去噪后的数据.csv", sep=',',encoding='gbk')
print(data1.head())
data1 = data1.iloc[:,2:]
print(data.head())
plt.figure(figsize=(12,8))
for i in range(46):
    data1.iloc[i,:].plot()
plt.title("预处理之后的光谱图")
plt.savefig("光谱预处理图.png")
plt.show()

